﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace laba2.Entity
{
    public class Evaluation : Entity
    {
        private int _minimum;
        private int _maximum;
        private string _evaluation;
        public int CourseId { get; set; }
        private Course _course;

        public Evaluation(int id, int minimum, int maximum, string evaluation, Course course) : base(id)
        {
            _minimum = minimum;
            _maximum = maximum;
            _evaluation = evaluation;
            _id = id;
            _course = course;
        }

        public Evaluation(int minimum, int maximum, string evaluation, Course course)
        {
            _minimum = minimum;
            _maximum = maximum;
            _evaluation = evaluation;
            _course = course;
        }

        public Evaluation(string evaluation, int maximum, int minimum, int courseId)
        {
            _evaluation = evaluation;
            _maximum = maximum;
            _minimum = minimum;
            CourseId = courseId;
        }

        public Evaluation()
        {
        }

        public int Minimum
        {
            get { return _minimum; }
            set { _minimum = value; }
        }

        public int Maximum
        {
            get { return _maximum; }
            set { _maximum = value; }
        }

        public string Evaluation1
        {
            get { return _evaluation; }
            set { _evaluation = value; }
        }

        public Course Course
        {
            get { return _course; }
            set { _course = value; }
        }

        public bool isEvaluation(int rating)
        {
            return (_minimum <= rating && _maximum >= rating);
        }
    }
}
